Skip to content

perf(turn): defer semantic preference recall during preview - #8254

Merged
huangruiteng merged 3 commits into
mainfrom
codex/turn-preview-import-boundary-20261107
Nov 7, 2026
Merged

huangruiteng merged 3 commits into
mainfrom
codex/turn-preview-import-boundary-20261107

Conversation

@loopx-agent

@loopx-agent loopx-agent commented Nov 7, 2026 •

Copy link
Copy Markdown
Collaborator

Goal And Delivered Outcome

A read-only loopx turn plan checks local Agent preferences. Importing that hook also loaded the extension recall and reward-memory packages. The semantic-preference package now resolves its existing public exports on demand.

Fresh File and SQLite previews each loaded 661 → 654 Python modules. The two revisions selected the same Todo, route and iteration context, and the Goal and registry read back identically.

Author Declaration

Written by model_agent, OpenAI Codex.

The contract is the existing local preference hook and the five public semantic-preference exports. The real CLI regression checks that the hook leaves extension recall and reward memory unloaded. The export check verifies the original provider objects, and two configured extension tests verify provider selection.

Scope And Continuation

This proposal owns the preference import path. The Git probe and validation process changes belong to #8218. Both of those files were also exercised with this patch on a C1 source preview. The complete #8218 branch has four merge conflicts with current main across its RFC and other callers.

Validation

  • Base b9faf8da06edea8d770d406b765ebcdc31149801
  • Tested revision 98dfeea0a222e004c956de73a59a28d7443846e9
  • Run state finished with synthetic fixtures
Check kind Result Evidence
regression_parity passed The fresh-process preview assertion fails on baseline for both File and SQLite, then passes with the same plan at this head.
integration passed 12 tests cover real CLI preview, local preference context and configured extension resolution. All five public exports retain their original objects.
real_entrypoint passed The first-connect smoke passes on current main and the C1 source preview with #8222.
static passed Standard premerge, focused Ruff and the public boundary scan. Premerge ran six direct and two selected checks.

The module count comes from fresh source-checkout processes. This validation covers the local CLI and its configured preference paths.

Frontend / Visual Evidence

UI impact none.

Keep process-tree cleanup and semantic preference recall on their selected paths. Exercise the normal Turn plan entrypoint in fresh File and SQLite fixture processes and preserve bounded Git and validation cleanup.

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
…rn-preview-import-boundary-20261107

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Keep the distinct recall import seam and its real CLI regression. The process transport proposal owns the shared cleanup callers.

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
@loopx-agent loopx-agent changed the title perf(turn): defer optional modules on read-only previews perf(turn): defer semantic preference recall during preview Nov 7, 2026

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: model_agent, gpt-6.1-sol, OpenAI, runtime_reported, reasoning_effort=max

Approval conclusion (author-owned PR; GitHub blocks formal self-approval)

动机 / Motivation

运维人员和 Agent 用只读 Turn 预览确认当前 Todo、准入和会话路线。 在冷进程预览时,原来的本地偏好入口提前加载了扩展召回和 reward memory。局部偏好可以直接读取,这两类扩展由各自的实际操作选择。 File 和 SQLite 的正常预览均从 661 降到 654 个模块,缺 Todo 的拒绝路径均从 659 降到 652 个。两组前后返回同一计划或拒绝。 当前两文件提案只调整偏好包的加载时点。Git 探针和验证进程的加载边界由 #8218 单独推进。实际安装和时延未测。

改动思路 / Approach

偏好包保留五个原函数的定义与可发现性,访问相应公开名称时才解析它所属的模块。只读入口继续读取本地偏好。 当前两文件提案只调整偏好包的加载时点。Git 探针和验证进程的加载边界由 #8218 单独推进。实际安装和时延未测。 保留包的目录查询和原公开对象,避免逐个改调用方或增加 provider 入口。

具体改动 / Changes

固定 head 98dfeea 和实际 merge base b9faf8d。最新 main 4437696 的变更与两文件及原进程调用点无交叠,本地试算合并树无冲突。全 diff 两路径 +65/−35。旧 head c65486e 的 Git 探针和校验改动已移出,对当前两条路径重新执行验证。 独立进程提案

关键代码讲解

  • getattr 从五个确定名称选择已有模块,首次访问后缓存原对象。未知名返回原属性错误。 原 API 出口
  • dir 列出尚未解析的原公开名,目录查询不触发召回。实际 Turn 测试在 File、SQLite 两种 Goal 的新进程断言未选择模块,并保留原 fresh session 断言。 发现入口 · 预览回归

依据 docs/reference/protocols/loopx-turn-v0.md 的 b9faf8d 版本。preview-without-effects 覆盖合法和无效 Todo。unselected-observer 覆盖普通冷预览、五个出口和配置扩展。 Turn 生命周期

对主干的风险 / Risks

两个后端的 route、session、退出和四项 effects 逐项相同,registry、Goal 和权威文件内容摘要不变。 指定不存在的 Todo,两个版本都拒绝且无替代任务、Host、写回、scheduler ACK 或扣额。 dir、显式属性、星号导入与五个原函数对象一致。未知属性拒绝,已配置扩展按原选择规则运行。 两个版本的独立探测均按实际 Turn 入口执行。原配置偏好与当前预览、拒绝的聚焦回归通过。当前精确 head 的 standard premerge 通过 6 个直接、2 个选中检查。当前主干的首次连接 smoke 也通过。 当前 main 的首连 smoke 使用 #8222 修复,旧 head 的导航误读仅作历史记录。 首连修复

规定 Ruff 两端均报 F841 tests/control_plane/test_goal_create_completion.py:184:9。原导入边界断言在两端都只剩 process_runtime,未改动的清理导入仍由 #8218 处理。没有删去这两个失败,也没有用本 PR 的偏好通过覆盖它们。

我的整体评价 / Verdict

当前精确 head 的偏好切片通过评审,未发现阻塞项。既有预览的选择、拒绝及零效果保持,五个公开函数和配置扩展可用。性能证据只到冷进程的模块数,已安装版本及耗时未测。规定 Ruff 和独立进程断言作为剩余验证记录。

English verdict: APPROVE for 98dfeea. File and SQLite previews load seven fewer modules with equivalent routes and effects. Existing lint and process import failures are recorded separately.

@huangruiteng
huangruiteng merged commit ce17fb4 into main Nov 7, 2026
23 of 29 checks passed
@huangruiteng
huangruiteng deleted the codex/turn-preview-import-boundary-20261107 branch November 7, 2026 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants